package study.线程池.forkJoin;

import study.User;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;

/**
 * @Author 刘伟涛
 * @Date 2023/12/5 16:58
 **/
public class Demo02 {
    public static void main(String[] args) {
        List<User> list = Arrays.asList(new User(12, "志四", 25),
                new User(14, "婵五", 24),
                new User(14, "婵五", 24),
                new User(14, "婵五", 24),
                new User(14, "婵五", 24),
                new User(14, "婵五", 24),
                new User(14, "婵五", 24),
                new User(13, "张二", 23));
        System.out.println("执行任务前：" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss")));
        SimpleTask simpleTask = new SimpleTask(list, 0, list.size());
        String compute = simpleTask.compute();
        System.out.println("执行结束：" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss")));
        System.out.println(compute);
    }
}
